<script>
  // 1
  function doubleNumber() {
    // your code here
  }
  console.log([2, 5, 100].map(doubleNumber)) // [4, 10, 200]

  // 2
  function stringItUp() {
    // your code here
  }

  console.log([2, 5, 100].map(stringItUp)) // ["2", "5", "100"]

  // 3
  function capitalizeName() {
    // your code here
  }

  console.log(['john', 'JACOB', 'jinGleHeimer', 'schmidt'].map(capitalizeName)) // ["John", "Jacob", "Jingleheimer", "Schmidt"]

  // 4
  function nameOnly() {
    // your code here
  }

  console.log(
    [
      {
        name: 'Angelina Jolie',
        age: 80,
      },
      {
        name: 'Eric Jones',
        age: 2,
      },
      {
        name: 'Paris Hilton',
        age: 5,
      },
      {
        name: 'Kayne West',
        age: 16,
      },
      {
        name: 'Bob Ziroll',
        age: 100,
      },
    ].map(nameOnly)
  )
  // ["Angelina Jolie", "Eric Jones", "Paris Hilton", "Kayne West", "Bob Ziroll"]

  // 5
  function makeStrings() {
    // your code here
    // 条件 age > 20
  }

  console.log(
    [
      {
        name: 'Angelina Jolie',
        age: 80,
      },
      {
        name: 'Eric Jones',
        age: 2,
      },
      {
        name: 'Paris Hilton',
        age: 5,
      },
      {
        name: 'Kayne West',
        age: 16,
      },
      {
        name: 'Bob Ziroll',
        age: 100,
      },
    ].map(makeStrings)
  )
  // ["Angelina Jolie 可以去黑客帝国。",
  // "Eric Jones 年纪太小!!",
  // "Paris Hilton 年纪太小!!",
  // "Kayne West 年纪太小!!",
  // "Bob Ziroll 可以去黑客帝国。"]

  //6
  function readyToPutInTheDOM() {
    // your code here
  }
  console.log(
    [
      {
        name: 'Angelina Jolie',
        age: 80,
      },
      {
        name: 'Eric Jones',
        age: 2,
      },
      {
        name: 'Paris Hilton',
        age: 5,
      },
      {
        name: 'Kayne West',
        age: 16,
      },
      {
        name: 'Bob Ziroll',
        age: 100,
      },
    ].map(readyToPutInTheDOM)
  )
  // ["<h1>Angelina Jolie</h1><h2>80</h2>",
  // "<h1>Eric Jones</h1><h2>2</h2>",
  // "<h1>Paris Hilton</h1><h2>5</h2>",
  // "<h1>Kayne West</h1><h2>16</h2>",
  // "<h1>Bob Ziroll</h1><h2>100</h2>"]
</script>
